#include<stdio.h>
int main()
{
    int a, max = 0, small = 100, sum = 0, count = 0;
    while (scanf_s("%d", &a) != EOF)
    {
        if (a > max)
        {
            max = a;
        }
        if (a < small)
        {
            small = a;
        }
        sum += a;
        count++;
        if (count == 7)
        {
            printf("%.2f\n", (sum - max - small) / 5.0);
            count = 0;
            max = 0;
            small = 100;
            sum = 0;
        }

    }

    return 0;
}